package com.xzc.algorithm.data_structure_ke.LinkedList;

import lombok.Data;

@Data
public class LinkStack<T> {
    private LinkListDummyHead<T> data;

    public LinkStack(LinkListDummyHead<T> data) {
        this.data = data;
    }

    public void push(T t) throws Exception {
        data.addFirst(t);
    }

    public T pop() throws Exception {
        return data.removeFirst();
    }

    @Override
    public String toString() {
        return data.toString();
    }
}
